#include "DetourPathCorridor.h"
#ifdef __cplusplus
extern "C" {
#endif
void nav_dtPathCorridor_Delete(dtPathCorridor * c_this){
	if(c_this==0){
	    return;
	}
	delete c_this;
}

void nav_dtPathCorridor_DeleteArray(dtPathCorridor * c_this){
	if(c_this==0){
		return;
	}
	delete []c_this;
}

dtPathCorridor * nav_NewdtPathCorridor(){
	dtPathCorridor* wrap_out = new dtPathCorridor();
	return wrap_out;
}

int nav_dtPathCorridor_findCorners(dtPathCorridor * c_this,float * cornerVerts,unsigned char * cornerFlags,dtPolyRef * cornerPolys,int const maxCorners,dtNavMeshQuery * navquery,dtQueryFilter const * filter){
	float * c_arg_cornerVerts=(float *)(void*)(cornerVerts);
	unsigned char * c_arg_cornerFlags=(unsigned char *)(void*)(cornerFlags);
	dtPolyRef * c_arg_cornerPolys=(dtPolyRef *)(void*)(cornerPolys);
	int const c_arg_maxCorners=maxCorners;
	dtNavMeshQuery * c_arg_navquery=(dtNavMeshQuery *)(void*)(navquery);
	dtQueryFilter const * c_arg_filter=(dtQueryFilter const *)(void*)(filter);
	int c_out = c_this->findCorners(c_arg_cornerVerts,c_arg_cornerFlags,c_arg_cornerPolys,c_arg_maxCorners,c_arg_navquery,c_arg_filter);
	int wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtPathCorridor_fixPathStart(dtPathCorridor * c_this,dtPolyRef safeRef,float const * safePos){
	dtPolyRef c_arg_safeRef=safeRef;
	float const * c_arg_safePos=(float const *)(void*)(safePos);
	bool c_out = c_this->fixPathStart(c_arg_safeRef,c_arg_safePos);
	bool wrap_out  = (c_out);
	return wrap_out;
}

dtPolyRef nav_dtPathCorridor_getFirstPoly(dtPathCorridor const * c_this){
	dtPolyRef c_out = c_this->getFirstPoly();
	dtPolyRef wrap_out  = (c_out);
	return wrap_out;
}

dtPolyRef nav_dtPathCorridor_getLastPoly(dtPathCorridor const * c_this){
	dtPolyRef c_out = c_this->getLastPoly();
	dtPolyRef wrap_out  = (c_out);
	return wrap_out;
}

dtPolyRef const * nav_dtPathCorridor_getPath(dtPathCorridor const * c_this){
	dtPolyRef const * c_out = c_this->getPath();
	dtPolyRef const * wrap_out  = (dtPolyRef const *)(void*)(c_out);
	return wrap_out;
}

int nav_dtPathCorridor_getPathCount(dtPathCorridor const * c_this){
	int c_out = c_this->getPathCount();
	int wrap_out  = (c_out);
	return wrap_out;
}

float const * nav_dtPathCorridor_getPos(dtPathCorridor const * c_this){
	float const * c_out = c_this->getPos();
	float const * wrap_out  = (float const *)(void*)(c_out);
	return wrap_out;
}

float const * nav_dtPathCorridor_getTarget(dtPathCorridor const * c_this){
	float const * c_out = c_this->getTarget();
	float const * wrap_out  = (float const *)(void*)(c_out);
	return wrap_out;
}

dtPathCorridor * nav_dtPathCorridor_IndexArray(dtPathCorridor * c_this,long n){
	if(c_this==0){
		return 0;
	}
	c_this+=n;
	return c_this;
}

bool nav_dtPathCorridor_init(dtPathCorridor * c_this,int const maxPath){
	int const c_arg_maxPath=maxPath;
	bool c_out = c_this->init(c_arg_maxPath);
	bool wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtPathCorridor_isValid(dtPathCorridor * c_this,int const maxLookAhead,dtNavMeshQuery * navquery,dtQueryFilter const * filter){
	int const c_arg_maxLookAhead=maxLookAhead;
	dtNavMeshQuery * c_arg_navquery=(dtNavMeshQuery *)(void*)(navquery);
	dtQueryFilter const * c_arg_filter=(dtQueryFilter const *)(void*)(filter);
	bool c_out = c_this->isValid(c_arg_maxLookAhead,c_arg_navquery,c_arg_filter);
	bool wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtPathCorridor_moveOverOffmeshConnection(dtPathCorridor * c_this,dtPolyRef offMeshConRef,dtPolyRef * refs,float * startPos,float * endPos,dtNavMeshQuery * navquery){
	dtPolyRef c_arg_offMeshConRef=offMeshConRef;
	dtPolyRef * c_arg_refs=(dtPolyRef *)(void*)(refs);
	float * c_arg_startPos=(float *)(void*)(startPos);
	float * c_arg_endPos=(float *)(void*)(endPos);
	dtNavMeshQuery * c_arg_navquery=(dtNavMeshQuery *)(void*)(navquery);
	bool c_out = c_this->moveOverOffmeshConnection(c_arg_offMeshConRef,c_arg_refs,c_arg_startPos,c_arg_endPos,c_arg_navquery);
	bool wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtPathCorridor_movePosition(dtPathCorridor * c_this,float const * npos,dtNavMeshQuery * navquery,dtQueryFilter const * filter){
	float const * c_arg_npos=(float const *)(void*)(npos);
	dtNavMeshQuery * c_arg_navquery=(dtNavMeshQuery *)(void*)(navquery);
	dtQueryFilter const * c_arg_filter=(dtQueryFilter const *)(void*)(filter);
	bool c_out = c_this->movePosition(c_arg_npos,c_arg_navquery,c_arg_filter);
	bool wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtPathCorridor_moveTargetPosition(dtPathCorridor * c_this,float const * npos,dtNavMeshQuery * navquery,dtQueryFilter const * filter){
	float const * c_arg_npos=(float const *)(void*)(npos);
	dtNavMeshQuery * c_arg_navquery=(dtNavMeshQuery *)(void*)(navquery);
	dtQueryFilter const * c_arg_filter=(dtQueryFilter const *)(void*)(filter);
	bool c_out = c_this->moveTargetPosition(c_arg_npos,c_arg_navquery,c_arg_filter);
	bool wrap_out  = (c_out);
	return wrap_out;
}

bool nav_dtPathCorridor_optimizePathTopology(dtPathCorridor * c_this,dtNavMeshQuery * navquery,dtQueryFilter const * filter){
	dtNavMeshQuery * c_arg_navquery=(dtNavMeshQuery *)(void*)(navquery);
	dtQueryFilter const * c_arg_filter=(dtQueryFilter const *)(void*)(filter);
	bool c_out = c_this->optimizePathTopology(c_arg_navquery,c_arg_filter);
	bool wrap_out  = (c_out);
	return wrap_out;
}

void nav_dtPathCorridor_optimizePathVisibility(dtPathCorridor * c_this,float const * next,float const pathOptimizationRange,dtNavMeshQuery * navquery,dtQueryFilter const * filter){
	float const * c_arg_next=(float const *)(void*)(next);
	float const c_arg_pathOptimizationRange=pathOptimizationRange;
	dtNavMeshQuery * c_arg_navquery=(dtNavMeshQuery *)(void*)(navquery);
	dtQueryFilter const * c_arg_filter=(dtQueryFilter const *)(void*)(filter);
	c_this->optimizePathVisibility(c_arg_next,c_arg_pathOptimizationRange,c_arg_navquery,c_arg_filter);
}

void nav_dtPathCorridor_reset(dtPathCorridor * c_this,dtPolyRef ref,float const * pos){
	dtPolyRef c_arg_ref=ref;
	float const * c_arg_pos=(float const *)(void*)(pos);
	c_this->reset(c_arg_ref,c_arg_pos);
}

void nav_dtPathCorridor_setCorridor(dtPathCorridor * c_this,float const * target,dtPolyRef const * polys,int const npath){
	float const * c_arg_target=(float const *)(void*)(target);
	dtPolyRef const * c_arg_polys=(dtPolyRef const *)(void*)(polys);
	int const c_arg_npath=npath;
	c_this->setCorridor(c_arg_target,c_arg_polys,c_arg_npath);
}

bool nav_dtPathCorridor_trimInvalidPath(dtPathCorridor * c_this,dtPolyRef safeRef,float const * safePos,dtNavMeshQuery * navquery,dtQueryFilter const * filter){
	dtPolyRef c_arg_safeRef=safeRef;
	float const * c_arg_safePos=(float const *)(void*)(safePos);
	dtNavMeshQuery * c_arg_navquery=(dtNavMeshQuery *)(void*)(navquery);
	dtQueryFilter const * c_arg_filter=(dtQueryFilter const *)(void*)(filter);
	bool c_out = c_this->trimInvalidPath(c_arg_safeRef,c_arg_safePos,c_arg_navquery,c_arg_filter);
	bool wrap_out  = (c_out);
	return wrap_out;
}

int nav_dtMergeCorridorEndMoved(dtPolyRef * path,int const npath,int const maxPath,dtPolyRef const * visited,int const nvisited){
	dtPolyRef * c_arg_path=(dtPolyRef *)(void*)(path);
	int const c_arg_npath=npath;
	int const c_arg_maxPath=maxPath;
	dtPolyRef const * c_arg_visited=(dtPolyRef const *)(void*)(visited);
	int const c_arg_nvisited=nvisited;
	int c_out = dtMergeCorridorEndMoved(c_arg_path,c_arg_npath,c_arg_maxPath,c_arg_visited,c_arg_nvisited);
	int wrap_out  = (c_out);
	return wrap_out;
}

int nav_dtMergeCorridorStartMoved(dtPolyRef * path,int const npath,int const maxPath,dtPolyRef const * visited,int const nvisited){
	dtPolyRef * c_arg_path=(dtPolyRef *)(void*)(path);
	int const c_arg_npath=npath;
	int const c_arg_maxPath=maxPath;
	dtPolyRef const * c_arg_visited=(dtPolyRef const *)(void*)(visited);
	int const c_arg_nvisited=nvisited;
	int c_out = dtMergeCorridorStartMoved(c_arg_path,c_arg_npath,c_arg_maxPath,c_arg_visited,c_arg_nvisited);
	int wrap_out  = (c_out);
	return wrap_out;
}

int nav_dtMergeCorridorStartShortcut(dtPolyRef * path,int const npath,int const maxPath,dtPolyRef const * visited,int const nvisited){
	dtPolyRef * c_arg_path=(dtPolyRef *)(void*)(path);
	int const c_arg_npath=npath;
	int const c_arg_maxPath=maxPath;
	dtPolyRef const * c_arg_visited=(dtPolyRef const *)(void*)(visited);
	int const c_arg_nvisited=nvisited;
	int c_out = dtMergeCorridorStartShortcut(c_arg_path,c_arg_npath,c_arg_maxPath,c_arg_visited,c_arg_nvisited);
	int wrap_out  = (c_out);
	return wrap_out;
}

dtPathCorridor * nav_NewDtPathCorridorPtrArray(long n){
	dtPathCorridor* c_this=new dtPathCorridor[n];
	return c_this;
}

#ifdef __cplusplus
}
#endif
